//
//  ByNetOrderModel.h
//  beibei_ios
//
//  Created by pro on 16/5/18.
//  Copyright © 2016年 hebidu. All rights reserved.
//

#import "ByNetBaseModel.h"

#import "ByNetOrderItemModel.h" // 订单商品



// 订单状态
typedef enum : NSUInteger {
    ORDER_BACK              = 12, // 订单退回
    ORDER_TOBE_CONFIRMED    = 2,  // 待确认
    ORDER_TOBE_SHIPPED      = 3,  // 待发货
    ORDER_SHIPPED           = 4,  // 已发货
    ORDER_RECEIPT_OF_GOODS  = 5,  // 已收货
    ORDER_RETURNED          = 6,  // 已退货
    ORDER_COMPLETED         = 7,  // 已完成
    ORDER_CANCEL            = 8,  // 取消或交易关闭
    ORDER_RESENDS           = 9,  // 正在退款
} ByOrderStatuType;

// 支付状态
typedef enum : NSUInteger {
    ORDER_TOBE_PAID         = 0,  // 待支付
    ORDER_CASH_ON_DELIVERY  = 5,  // 货到付款
    ORDER_PAID              = 1,  // 已支付
    ORDER_REFUND            = 2,  // 已退款

} ByPayStatuType;

// 订单售后状态
typedef enum : NSUInteger {
    ORDER_TOBE_TAKE         = 2,  // 待处理
    ORDER_TAKED             = 3,  // 已处理
} ByCsStatuType;

/**地址Model*/
@interface ByNetOrderAddModel : ByNetBaseModel
@property (nonatomic, copy) NSString *add_id;
@property (nonatomic, copy) NSString *contactname;
@property (nonatomic, copy) NSString *uid;
@property (nonatomic, copy) NSString *country;
@property (nonatomic, copy) NSString *province;
@property (nonatomic, copy) NSString *detailinfo;
@property (nonatomic, copy) NSString *area;
@property (nonatomic, copy) NSString *mobile;
@property (nonatomic, copy) NSString *notes;
@property (nonatomic, copy) NSString *wxno;
@property (nonatomic, copy) NSString *order_code;
@property (nonatomic, copy) NSString *postal_code;
@property (nonatomic, copy) NSString *id_card;
@property (nonatomic, copy) NSString *city;

@end

/***物流model*/
@interface ByOrderLogisticModel : ByNetBaseModel
@property (nonatomic, copy) NSString *updatetime;
@property (nonatomic, copy) NSString *expressno;
@property (nonatomic, copy) NSString *expresscode;
@property (nonatomic, copy) NSString *expressname;

@end


/** 订单 model */
@interface ByNetOrderModel : ByNetBaseModel

/** 仅作参数 */
@property (nonatomic, copy) NSString *status;           // 订单状态参数
@property (nonatomic, copy) NSString *page_no;          // 页码
@property (nonatomic, copy) NSString *page_size;        // 单页个数
@property (nonatomic, copy) NSString *cart_ids;         // 购物车id集合，用英文“，”隔开，如：12,14,15
@property (nonatomic, copy) NSString *address_id;       // 地址id
@property (nonatomic, copy) NSString *reason;           // 售后原因
@property (nonatomic, copy) NSString *pid;              // 商品ID，多个以‘,’分割
@property (nonatomic, copy) NSString *score;            // 商品评分 0.00-5.00，多个以‘,’分割
@property (nonatomic, copy) NSArray  *comment;          // 评论内容，数组
@property (nonatomic, copy) NSString *attachments;      // 附件，多个以‘-’分割，多个商品的以‘，’分割
@property (nonatomic, copy) NSString *psku_id;
@property (nonatomic, copy) NSString *red_id;
@property (nonatomic, copy) NSString *coupon_id;
@property (nonatomic, copy) NSString *money;
@property (nonatomic, copy) NSString *pay_balance;
@property (nonatomic, copy) NSString *pay_money;

/**订单查询*/
@property (nonatomic, copy) NSString *query_status;
@property (nonatomic, copy) NSString *page_index;
@property (nonatomic, copy) NSString *publisher_name;
@property (nonatomic, copy) NSString *keyword;
@property (nonatomic, copy) ByNetOrderAddModel *addressModel;
@property (nonatomic, copy) ByOrderLogisticModel *logisticModel;
@property (nonatomic, copy) NSString *_auto_op_time;

//@property (nonatomic, copy) NSArray *_address;
//@property (nonatomic, copy) NSArray *_express;




/** 订单支付所需参数 */
@property (nonatomic, copy) NSString *code;             
@property (nonatomic, copy) NSString *name;
@property (nonatomic, copy) NSString *desc;
@property (nonatomic, copy) NSString *total_price;
@property (nonatomic, copy) NSString *key;
@property (nonatomic, copy) NSString *show_url;
- (BOOL)isLegal;


/** 参数或属性 */
@property (nonatomic, copy) NSString *oid;              // 订单id
@property (nonatomic, copy) NSString *uid;              //
@property (nonatomic, copy) NSString *order_code;       // 订单号
@property (nonatomic, copy) NSString *price;            // 订单总价，包括运费、优惠
@property (nonatomic, copy) NSString *post_price;       // 运费价格
@property (nonatomic, copy) NSString *discount_money;   // 优惠的价格
@property (nonatomic, copy) NSString *goods_amount;     // 货物价格
@property (nonatomic, copy) NSString *tax_amount;       // 税收
@property (nonatomic, copy) NSNumber *pay_status;       // 支付状态
@property (nonatomic, copy) NSNumber *order_status;     // 订单状态
@property (nonatomic, copy) NSNumber *cs_status;        // 售后状态
@property (nonatomic, copy) NSNumber *comment_status;   // 评价状态



@property (nonatomic, copy) NSString *country;          // 国家
@property (nonatomic, copy) NSString *province;         // 省份
@property (nonatomic, copy) NSString *city;             // 城市
@property (nonatomic, copy) NSString *area;             // 地区
@property (nonatomic, copy) NSString *detailinfo;       // 详细地址
@property (nonatomic, copy) NSString *contactname;      // 联系人
@property (nonatomic, copy) NSString *mobile;           // 手机
@property (nonatomic, copy) NSString *id_card;          // 身份证
@property (nonatomic, copy) NSString *username;         //

@property (nonatomic, copy) NSArray *items;             // 订单中的商品（itemModel）

@property (nonatomic, copy) NSString *refund_type;      //售后类型，1=>退款,2=>退货,3=>退货退款
@property (nonatomic, copy) NSString *goods_get;        //是否收到货物
@property (nonatomic, copy) NSString *refund_money;     //退款金额
@property (nonatomic, copy) NSString *refund_time;




/** 不常用 */
@property (nonatomic, copy) NSNumber *wxno;             // 微信号
@property (nonatomic, copy) NSString *note;             // 用户标注
@property (nonatomic, copy) NSString *createtime;       //
@property (nonatomic, copy) NSString *updatetime;       //
@property (nonatomic, copy) NSString *status_note;      //
@property (nonatomic, copy) NSString *from;             //
@property (nonatomic, copy) NSString *idcode;           // 优惠码id
@property (nonatomic, copy) NSString *storeid;          // 店铺id
@property (nonatomic, copy) NSString *pay_type;         // 支付类型
@property (nonatomic, copy) NSString *pay_code;         //
@property (nonatomic, copy) NSString *count;            //个数
@property (nonatomic, copy) NSString *service_phone;    //联系电话

@property (nonatomic, strong)NSArray  *notes;
@property (nonatomic, copy)  NSString *red_ids;
@property (nonatomic, copy)  NSString *coupon_ids;
@property (nonatomic, copy)  NSString *red_envelop_money;
@property (nonatomic, copy)  NSString *coupon_money;
@property (nonatomic, copy)  NSString *group_id;
@property (nonatomic, copy)  NSString *package_id;
@property (nonatomic, copy)  NSString *ids;


@property (nonatomic, copy) NSString *sku_pkid;
@property (nonatomic, copy) NSString *payPal_id;
@property (nonatomic, copy) NSString *currency;  //货币单位
@property (nonatomic, copy) NSString *pay_money_usd;


@end
